package com.itheima.ExtendsDemo;

public class Dog extends Animals {
    @Override
    public  void eat(){
        System.out.println("吃骨头");
    }
    public void roar(){
        System.out.println("汪汪汪");
    }
    public static void play() {
        System.out.println("子类静态");
    }
    public  void sleep(){
        System.out.println("子类非静态");
    }
    public static void main(String[] args) {
        String name="Dog";
        Animals animals=new Dog();
        //System.out.println(name);
       // ((Dog) animals).roar();//向下转型，多态弊端
       animals.play();
       animals.sleep();
        //Dog.play();
    }
}
